package lab02.test19;

/**
 * Created by leovo on 2017/11/1.
 */
public class Text01 {
    public static void main(String[] args) {
        String result = "HelloWord";
        char tmp;
        int i;
        //行为；实现字符串的大小写转换
        for (i = 0; i < result.length(); i++) {
            tmp = result.charAt(i);//得到第几个字符
            if (tmp >= 'A' && tmp <= 'Z') {
                System.out.print((char) (tmp + 32));//强制类型转化
            } else if  // 并倒序输出
                    (tmp >= 'a' && tmp <= 'z') {
                System.out.print((char) (tmp - 32));
            }
        }
    }
}
